<?php

namespace app\admin\controller;

use app\Lib\Exception\BlException;
use app\Lib\Exception\CommonException;

class Index extends Common
{
    public function index()
    {
        $this->view->engine->layout('layout/admin');
        return $this->fetch();
    }

    public function main()
    {
        return $this->fetch();
    }

    public function exceptionTest()
    {
        try {
            throw new BlException('err');

        } catch (CommonException $e) {
            echo $e->getMessage() . PHP_EOL;
            echo $e->getCode() . PHP_EOL;
            echo $e->getErrLevel();
            dump($e->getData());
        }
    }
}
